package admin

import (
	"fmt"
	"oc_saas/glo"
	admin_req "oc_saas/model/req/admin"
	"oc_saas/utils/tool"

	"github.com/gin-gonic/gin"
)

type Rule struct{}

func (*Rule) Add(c *gin.Context) {
	var data admin_req.RuleForm
	err := c.ShouldBindJSON(&data)
	if err != nil {
		panic(err)
	}
	err = glo.OC_VALID.Struct(data)
	if err != nil {
		panic(err)
	}
	fmt.Println(data)
	tool.Ok(c)
}

var RuleController = new(Rule)
